<!DOCTYPE html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head><meta name="generator" content="Hexo 3.9.0">
  <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<meta name="theme-color" content="#222">









<meta http-equiv="Cache-Control" content="no-transform">
<meta http-equiv="Cache-Control" content="no-siteapp">
















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css">







<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css">

<link href="/css/main.css?v=5.1.4" rel="stylesheet" type="text/css">


  <link rel="apple-touch-icon" sizes="180x180" href="/images/apple-touch-icon-next.png?v=5.1.4">


  <link rel="icon" type="image/png" sizes="32x32" href="/images/favicon32.ico?v=5.1.4">


  <link rel="icon" type="image/png" sizes="16x16" href="/images/favicon16.ico?v=5.1.4">


  <link rel="mask-icon" href="/images/logo.svg?v=5.1.4" color="#222">





  <meta name="keywords" content="CG,">










<meta name="description" content="在现实生活中，光来自各个方向，要么直接来自光源，要么间接地在环境中的物体反弹后，在此过程中被部分吸收。 在某种程度上，物体周围的整个环境都可以看作是一个光源。 图像，尤其是立方体贴图，是编码这种“环境光”的好方法。 这称为基于图像的照明 (IBL)，有时也称为间接照明。">
<meta name="keywords" content="CG">
<meta property="og:type" content="article">
<meta property="og:title" content="Lighting in Filament : IBL">
<meta property="og:url" content="http://htelepathh.gitee.io/2022/05/05/Lighting-in-Filament-IBL/index.html">
<meta property="og:site_name" content="OUTPUT">
<meta property="og:description" content="在现实生活中，光来自各个方向，要么直接来自光源，要么间接地在环境中的物体反弹后，在此过程中被部分吸收。 在某种程度上，物体周围的整个环境都可以看作是一个光源。 图像，尤其是立方体贴图，是编码这种“环境光”的好方法。 这称为基于图像的照明 (IBL)，有时也称为间接照明。">
<meta property="og:locale" content="zh-Hans">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/05/05/Lighting-in-Filament-IBL/DFG.jpg">
<meta property="og:image" content="http://htelepathh.gitee.io/2022/05/05/Lighting-in-Filament-IBL/LD.jpg">
<meta property="og:updated_time" content="2022-11-12T17:48:01.612Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Lighting in Filament : IBL">
<meta name="twitter:description" content="在现实生活中，光来自各个方向，要么直接来自光源，要么间接地在环境中的物体反弹后，在此过程中被部分吸收。 在某种程度上，物体周围的整个环境都可以看作是一个光源。 图像，尤其是立方体贴图，是编码这种“环境光”的好方法。 这称为基于图像的照明 (IBL)，有时也称为间接照明。">
<meta name="twitter:image" content="http://htelepathh.gitee.io/2022/05/05/Lighting-in-Filament-IBL/DFG.jpg">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    version: '5.1.4',
    sidebar: {"position":"left","display":"post","offset":12,"b2t":false,"scrollpercent":false,"onmobile":true},
    fancybox: true,
    tabs: true,
    motion: {"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://htelepathh.gitee.io/2022/05/05/Lighting-in-Filament-IBL/">





  <title>Lighting in Filament : IBL | OUTPUT</title>
  








</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/" class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">OUTPUT</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle">HTelepathH's blog</p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-message">
          <a href="/message" rel="section">
            
            留言
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal" itemscope itemtype="http://schema.org/Article">
  
  
  
  <div class="post-block">
    <link itemprop="mainEntityOfPage" href="http://htelepathh.gitee.io/2022/05/05/Lighting-in-Filament-IBL/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="HTelepathH">
      <meta itemprop="description" content>
      <meta itemprop="image" content="/images/MOB.jpg">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="OUTPUT">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">Lighting in Filament : IBL</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2022-05-05T01:19:00+08:00">
                2022-05-05
              </time>
            

            

            
          </span>

          
            <span class="post-category">
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/lighting/" itemprop="url" rel="index">
                    <span itemprop="name">lighting</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    
    
    
    <div class="post-body" itemprop="articleBody">

      
      

      
        <p>在现实生活中，光来自各个方向，要么直接来自光源，要么间接地在环境中的物体反弹后，在此过程中被部分吸收。 在某种程度上，物体周围的整个环境都可以看作是一个光源。 图像，尤其是立方体贴图，是编码这种“环境光”的好方法。 这称为基于图像的照明 (IBL)，有时也称为间接照明。<br><a id="more"></a></p>
<h3 id="IBL-Types"><a href="#IBL-Types" class="headerlink" title="IBL Types"></a>IBL Types</h3><p>现代渲染引擎中一共四种常见的IBL</p>
<ul>
<li><p><strong>Distant light probes</strong></p>
<p>平行光探针用于捕捉视差可以忽略的无限远的光照，一般包含天空，远处的地形或建筑特征。一般由引擎或相机生成，保存为HDRI</p>
</li>
<li><p><strong>Local light probes</strong></p>
<p>局部光探针用于从特定视点捕捉特定区域的光照，一般根据周围的几何投影到cube或者sphere上，局部光探针比平行光探针更加准确，对于材质的局部反射也非常有效</p>
</li>
<li><p><strong>Planar reflections</strong></p>
<p>镜面反射用于捕捉场景的镜像，一般只用于建筑物的地板，道路和水面。</p>
</li>
<li><p><strong>Screen space reflection</strong></p>
<p>屏幕空间反射用于捕捉基于渲染场景的反射（比如使用上一帧），一般基于深度缓存的ray-marching。SSR效果很好但消耗性能</p>
</li>
</ul>
<h3 id="Processing-light-probes"><a href="#Processing-light-probes" class="headerlink" title="Processing light probes"></a>Processing light probes</h3><p>实时计算radiance积分的IBL显然太过昂贵，因此必须对IBL进行预处理来加速实时交互。以下介绍加速light probes计算的方法</p>
<ul>
<li><p><strong>Specular reflectance</strong>: </p>
<p><strong>pre-filtered importance sampling</strong> and <strong>split-sum approximation</strong></p>
</li>
<li><p><strong>Diffuse reflectance</strong>: </p>
<p><strong>irradiance map</strong> and <strong>spherical harmonics</strong></p>
</li>
</ul>
<h4 id="Distant-light-probes"><a href="#Distant-light-probes" class="headerlink" title="Distant light probes"></a>Distant light probes</h4><h5 id="Diffuse-BRDF"><a href="#Diffuse-BRDF" class="headerlink" title="Diffuse BRDF"></a>Diffuse BRDF</h5><p>当漫反射使用Lambertian BRDF</p>
<script type="math/tex; mode=display">
\begin{align*}
   f_d(\sigma) &= \frac{\sigma}{\pi} \\
L_d(n, \sigma) &= \int_{\Omega} f_d(\sigma) L_{\bot}(l) \left< n\cdot l \right> dl \\
               &= \frac{\sigma}{\pi} \int_{\Omega} L_{\bot}(l) \left< n\cdot l \right> dl \\
               &= \frac{\sigma}{\pi} E_d(n) \quad \text{with the irradiance} \; 
        E_d(n) = \int_{\Omega} L_{\bot}(l) \left< n\cdot l \right> dl
\end{align*}</script><p>在离散域</p>
<script type="math/tex; mode=display">
E_d(n) \equiv \sum_{\forall \, i \in image} L_{\bot}(s_i) \left< n \cdot s_i \right> \Omega_s</script><p>显然可以使用上式依次计算出irradiance map的cube map。还可以使用<a href="https://htelepathh.gitee.io/2022/05/01/Spherical-Harmonics/">三阶SH系数</a>来近似，只用27个系数就可以近似低频的irradiance map。</p>
<h5 id="Specular-BRDF"><a href="#Specular-BRDF" class="headerlink" title="Specular BRDF"></a>Specular BRDF</h5><p>Specular BRDF要更加复杂，需要计算的$L_o$为</p>
<script type="math/tex; mode=display">
L_o(p,\omega_o) = \int_{\Omega^+}L_i(p,\omega_i) f_r(p,\omega_i,\omega_o)cos\theta_i d\omega_i</script><p><strong>The Classic Approximation</strong></p>
<script type="math/tex; mode=display">\int_\Omega f(x)g(x)dx\approx\frac{\int_\Omega f(x)dx}{\int_\Omega dx}\cdot\int_\Omega g(x)dx</script><p>when is accurate?</p>
<ul>
<li>g(x)’s support is small (glossy BRDF)</li>
<li>g(x) is smooth (diffuse BRDF)</li>
</ul>
<script type="math/tex; mode=display">L_o(p,\omega_o)\approx\frac{\int_{\Omega_{f_r}} L_i(p,\omega_i)d\omega_i}{\int_{\Omega_{f_r}}  d\omega_i}\cdot\int_{\Omega^+} f_r(p,\omega_i,\omega_o)cos\theta_i d\omega_i</script><h6 id="Split-sum-approximation"><a href="#Split-sum-approximation" class="headerlink" title="Split-sum approximation"></a>Split-sum approximation</h6><p>将上式的近似写为离散形式，注意采样pdf的归一化在BRDF项里</p>
<script type="math/tex; mode=display">\frac{1}{N}\sum_{k=1}^N\frac{L_i(l_k)f(l_k,v)cos\theta_{l_k}}{p(l_k,v)}\approx
(\frac{1}{N}\sum_{k=1}^NL_i(l_k))(\frac{1}{N}\sum_{k=1}^N\frac{f(l_k,v)cos\theta_{l_k}}{p(l_k,v)})</script><p>把第一项称作$LD(n, \alpha)$，第二项称作$I(f(n, v, \alpha))$，其中BRDF写为DFV形式</p>
<script type="math/tex; mode=display">f(l_i, n, \alpha) = \frac{D(h, \alpha)F(f_0, f_{90}, \left<v\cdot h\right>)G(l, v, \alpha)}{4(n\cdot l)(n\cdot v)}\\= D(h, \alpha)F(f_0, f_{90}, \left<v\cdot h\right>)V(l, v, \alpha)</script><p>对$D(h)$的重要性采样$h$，$h\rightarrow l$转换的Jacobian为$|J_{h\rightarrow l}|=4(v\cdot h)$，那么$l$采样的pdf为</p>
<script type="math/tex; mode=display">p(l)=\frac{p(h)}{|J_{h\rightarrow l}|}=\frac{D(h)(n\cdot h)}{4(v \cdot h)}</script><p>Fresnel为</p>
<script type="math/tex; mode=display">
F(f_0, f_{90}, \left<v\cdot h\right>) = f_0 (1 - F_c(\left<v\cdot h\right>)) + f_{90} F_c(\left<v\cdot h\right>) \\
F_c(\left<v\cdot h\right>) = (1 - \left<v\cdot h\right>)^5</script><p>将Fresnel，pdf，全部带入BRDF积分中</p>
<script type="math/tex; mode=display">
\begin{align*}
I(f(n, v, \alpha))  \equiv \frac{4}{N}\sum_i^N \left[\color{green}{f_0 (1 - F_c(\left<v\cdot h\right>)) + f_{90} F_c(\left<v\cdot h\right>)}\right] V(l_i, v, \alpha)\frac{\left<v\cdot h\right>}{\left<n\cdot h\right>} \left<n\cdot l\right> \\
\end{align*}</script><p>$I(f(n, v, \alpha))$可以分解为两个预计算项$DFG_1,DFG_2$</p>
<script type="math/tex; mode=display">
\begin{align*}
DFG_1(\alpha, \left<n\cdot v\right>) &=      \frac{4}{N}\sum_i^N  \color{green}{(1 - F_c(\left<v\cdot h\right>))} V(l_i, v, \alpha)\frac{\left<v\cdot h\right>}{\left<n\cdot h\right>} \left<n\cdot l\right> \\
DFG_2(\alpha, \left<n\cdot v\right>) &=      \frac{4}{N}\sum_i^N  \color{green}{     F_c(\left<v\cdot h\right>) } V(l_i, v, \alpha)\frac{\left<v\cdot h\right>}{\left<n\cdot h\right>} \left<n\cdot l\right> \\

\end{align*}</script><p>加上预计算的irradiance项$LD(n, \alpha)$</p>
<script type="math/tex; mode=display">
LD(n, \alpha) = \frac{\sum_i^N V(l_i, n, \alpha)\left<n\cdot l\right>L_t(l_i) }{\sum_i^N \left<n\cdot l\right>}</script><p>最终的$L_{out}$为</p>
<script type="math/tex; mode=display">
L_{out}(n,v,\alpha,f_0,f_{90}) \simeq LD(n, \alpha) \times \big[ f_0 \color{red}{DFG_1(n\cdot v, \alpha)} + f_{90} \color{red}{DFG_2(n\cdot v, \alpha)} \big]</script><p>预计算的$DFG_1,DFG_2$<a href="https://google.github.io/filament/Filament.html#table_texturedfg" target="_blank" rel="noopener">如下</a></p>
<img src="/2022/05/05/Lighting-in-Filament-IBL/DFG.jpg" title="使用$(n\cdot v,\alpha)$索引">
<p>irradiance项$LD$使用mip-map的cubemap存储，根据LOD增加，则预滤波的粗糙度增加。LOD与$\alpha$的映射为</p>
<script type="math/tex; mode=display">
\begin{align*}
    \alpha       &= \textbf{Roughness}^2                        \\
    lod_{\alpha} &= \alpha^{\frac{1}{2}} = \textbf{Roughness}  \\
\end{align*}</script><p>预计算的cubemap如下</p>
<img src="/2022/05/05/Lighting-in-Filament-IBL/LD.jpg" title="使用$\textbf{Roughness}$映射LOD">
<h5 id="Implementation"><a href="#Implementation" class="headerlink" title="Implementation"></a>Implementation</h5><p>在有$DFG_1,DFG_2,LD$预计算的情况下，IBL非常直观<br><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function">vec3 <span class="title">ibl</span><span class="params">(vec3 n, vec3 v, vec3 diffuseColor, vec3 f0, vec3 f90,</span></span></span><br><span class="line"><span class="function"><span class="params">        <span class="keyword">float</span> perceptualRoughness)</span> </span>&#123;</span><br><span class="line">    vec3 r = reflect(n);</span><br><span class="line">    vec3 Ld = textureCube(irradianceEnvMap, r) * diffuseColor;</span><br><span class="line">    <span class="keyword">float</span> lod = computeLODFromRoughness(perceptualRoughness);</span><br><span class="line">    vec3 Lld = textureCube(prefilteredEnvMap, r, lod);</span><br><span class="line">    vec2 Ldfg = textureLod(dfgLut, vec2(dot(n, v), perceptualRoughness), <span class="number">0.0</span>).xy;</span><br><span class="line">    vec3 Lr =  (f0 * Ldfg.x + f90 * Ldfg.y) * Lld;</span><br><span class="line">    <span class="keyword">return</span> Ld + Lr;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>
<p>diffuse部分也可不用irradiance map，改用SH<br><figure class="highlight c"><table><tr><td class="code"><pre><span class="line"><span class="function">vec3 <span class="title">irradianceSH</span><span class="params">(vec3 n)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// uniform vec3 sphericalHarmonics[9]</span></span><br><span class="line">    <span class="comment">// We can use only the first 2 bands for better performance</span></span><br><span class="line">    <span class="keyword">return</span></span><br><span class="line">          sphericalHarmonics[<span class="number">0</span>]</span><br><span class="line">        + sphericalHarmonics[<span class="number">1</span>] * (n.y)</span><br><span class="line">        + sphericalHarmonics[<span class="number">2</span>] * (n.z)</span><br><span class="line">        + sphericalHarmonics[<span class="number">3</span>] * (n.x)</span><br><span class="line">        + sphericalHarmonics[<span class="number">4</span>] * (n.y * n.x)</span><br><span class="line">        + sphericalHarmonics[<span class="number">5</span>] * (n.y * n.z)</span><br><span class="line">        + sphericalHarmonics[<span class="number">6</span>] * (<span class="number">3.0</span> * n.z * n.z - <span class="number">1.0</span>)</span><br><span class="line">        + sphericalHarmonics[<span class="number">7</span>] * (n.z * n.x)</span><br><span class="line">        + sphericalHarmonics[<span class="number">8</span>] * (n.x * n.x - n.y * n.y);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// <span class="doctag">NOTE:</span> this is the DFG LUT implementation of the function above</span></span><br><span class="line"><span class="function">vec2 <span class="title">prefilteredDFG_LUT</span><span class="params">(<span class="keyword">float</span> coord, <span class="keyword">float</span> NoV)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// coord = sqrt(roughness), which is the mapping used by the</span></span><br><span class="line">    <span class="comment">// IBL prefiltering code when computing the mipmaps</span></span><br><span class="line">    <span class="keyword">return</span> textureLod(dfgLut, vec2(NoV, coord), <span class="number">0.0</span>).rg;</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">vec3 <span class="title">evaluateSpecularIBL</span><span class="params">(vec3 r, <span class="keyword">float</span> perceptualRoughness)</span> </span>&#123;</span><br><span class="line">    <span class="comment">// This assumes a 256x256 cubemap, with 9 mip levels</span></span><br><span class="line">    <span class="keyword">float</span> lod = <span class="number">8.0</span> * perceptualRoughness;</span><br><span class="line">    <span class="comment">// decodeEnvironmentMap() either decodes RGBM or is a no-op if the</span></span><br><span class="line">    <span class="comment">// cubemap is stored in a float texture</span></span><br><span class="line">    <span class="keyword">return</span> decodeEnvironmentMap(textureCubeLodEXT(environmentMap, r, lod));</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="function">vec3 <span class="title">evaluateIBL</span><span class="params">(vec3 n, vec3 v, vec3 diffuseColor, vec3 f0, vec3 f90, <span class="keyword">float</span> perceptualRoughness)</span> </span>&#123;</span><br><span class="line">    <span class="keyword">float</span> NoV = max(dot(n, v), <span class="number">0.0</span>);</span><br><span class="line">    vec3 r = reflect(-v, n);</span><br><span class="line"></span><br><span class="line">    <span class="comment">// Specular indirect</span></span><br><span class="line">    vec3 indirectSpecular = evaluateSpecularIBL(r, perceptualRoughness);</span><br><span class="line">    vec2 env = prefilteredDFG_LUT(perceptualRoughness, NoV);</span><br><span class="line">    vec3 specularColor = f0 * env.x + f90 * env.y;</span><br><span class="line"></span><br><span class="line">    <span class="comment">// Diffuse indirect</span></span><br><span class="line">    <span class="comment">// We multiply by the Lambertian BRDF to compute radiance from irradiance</span></span><br><span class="line">    <span class="comment">// With the Disney BRDF we would have to remove the Fresnel term that</span></span><br><span class="line">    <span class="comment">// depends on NoL (it would be rolled into the SH). The Lambertian BRDF</span></span><br><span class="line">    <span class="comment">// can be baked directly in the SH to save a multiplication here</span></span><br><span class="line">    vec3 indirectDiffuse = max(irradianceSH(n), <span class="number">0.0</span>) * Fd_Lambert();</span><br><span class="line"></span><br><span class="line">    <span class="comment">// Indirect contribution</span></span><br><span class="line">    <span class="keyword">return</span> diffuseColor * indirectDiffuse + indirectSpecular * specularColor;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></p>

      
    </div>
    
    
    

    

    

    

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/CG/" rel="tag"># CG</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2022/05/01/Spherical-Harmonics/" rel="next" title="Spherical Harmonics">
                <i class="fa fa-chevron-left"></i> Spherical Harmonics
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
          </div>
        </div>
      

      
      
    </footer>
  </div>
  
  
  
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          

  



        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    
      <div id="sidebar-dimmer"></div>
    
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap">
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview-wrap">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview-wrap sidebar-panel">
        <div class="site-overview">
          <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
            
              <img class="site-author-image" itemprop="image" src="/images/MOB.jpg" alt="HTelepathH">
            
              <p class="site-author-name" itemprop="name">HTelepathH</p>
              <p class="site-description motion-element" itemprop="description">Learning by doing.</p>
          </div>

          <nav class="site-state motion-element">

            
              <div class="site-state-item site-state-posts">
              
                <a href="/archives">
              
                  <span class="site-state-item-count">25</span>
                  <span class="site-state-item-name">日志</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-categories">
                <a href="/categories/index.html">
                  <span class="site-state-item-count">12</span>
                  <span class="site-state-item-name">分类</span>
                </a>
              </div>
            

            
              
              
              <div class="site-state-item site-state-tags">
                <a href="/tags/index.html">
                  <span class="site-state-item-count">15</span>
                  <span class="site-state-item-name">标签</span>
                </a>
              </div>
            

          </nav>

          

          
            <div class="links-of-author motion-element">
                
                  <span class="links-of-author-item">
                    <a href="99088577@qq.com" target="_blank" title="Mail">
                      Mail</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://gitee.com/htelepathh" target="_blank" title="Gitee">
                      Gitee</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://github.com/htlpt" target="_blank" title="GitHub">
                      GitHub</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://weibo.com/u/6207125886" target="_blank" title="微博">
                      微博</a>
                  </span>
                
                  <span class="links-of-author-item">
                    <a href="https://www.zhihu.com/people/huang-he-tu" target="_blank" title="知乎">
                      知乎</a>
                  </span>
                
            </div>
          

          
          

          
          

          

        </div>
      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#IBL-Types"><span class="nav-number">1.</span> <span class="nav-text">IBL Types</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#Processing-light-probes"><span class="nav-number">2.</span> <span class="nav-text">Processing light probes</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#Distant-light-probes"><span class="nav-number">2.1.</span> <span class="nav-text">Distant light probes</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#Diffuse-BRDF"><span class="nav-number">2.1.1.</span> <span class="nav-text">Diffuse BRDF</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Specular-BRDF"><span class="nav-number">2.1.2.</span> <span class="nav-text">Specular BRDF</span></a><ol class="nav-child"><li class="nav-item nav-level-6"><a class="nav-link" href="#Split-sum-approximation"><span class="nav-number">2.1.2.1.</span> <span class="nav-text">Split-sum approximation</span></a></li></ol></li><li class="nav-item nav-level-5"><a class="nav-link" href="#Implementation"><span class="nav-number">2.1.3.</span> <span class="nav-text">Implementation</span></a></li></ol></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright">&copy; <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-angle-double-left"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">HTelepathH</span>

  
</div>




        







        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  
    <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>
  

  
  
    <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>
  

  
  
    <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>
  

  
  
    <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
  


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.4"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.4"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.4"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.4"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.4"></script>



  


  




	





  





  












  





  

  

  

  
  

  
  
    <script type="text/x-mathjax-config">
      MathJax.Hub.Config({
        tex2jax: {
          inlineMath: [ ['$','$'], ["\\(","\\)"]  ],
          displayMath: [ ['$$', '$$']],
          processEscapes: true,
          skipTags: ['script', 'noscript', 'style', 'textarea', 'pre', 'code']
        }
      });
    </script>

    <script type="text/x-mathjax-config">
      MathJax.Hub.Queue(function() {
        var all = MathJax.Hub.getAllJax(), i;
        for (i=0; i < all.length; i += 1) {
          all[i].SourceElement().parentNode.className += ' has-jax';
        }
      });
    </script>
    <script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
  


  

  

</body>
</html>
